package com.wing.bill.model.entity;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.math.BigDecimal;

/**
 * 账单付款发票信息
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("bill_ord_invoice_information")
public class BillOrdInvoiceInformation extends BaseEntity<BillOrdInvoiceInformation> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 账单编号
     */
    private String billNo;

    /**
     * 开票企业名称
     */
    private String enterpriseName;

    /**
     * 发票凭证文件
     */
    private String invoiceFile;

    /**
     * 发票编码
     */
    private String invoiceNo;

    /**
     * 开票金额
     */
    private BigDecimal invoiceMoney;

    /**
     * 税率
     */
    private String taxRate;

    /**
     * 税额
     */
    private String taxMoney;

    /**
     * 开票人
     */
    private String drawer;

    /**
     * 发票科目
     */
    private String invoiceSubject;

    /**
     * 发票税号
     */
    private String invoiceTaxno;

    /**
     * 企业id
     */
    private Long enterpriseId;


    /**
     * 收款账号
     */
    @TableField(exist = false)
    private String incomeNumber;

    /**
     * 收款账号开户行
     */
    @TableField(exist = false)
    private String incomeBank;

    /**
     * 收款账户
     */
    @TableField(exist = false)
    private String incomeAccount;
    /**
     * 付款账户
     */
    @TableField(exist = false)
    private String payAccount;

    /**
     * 付款开户行
     */
    @TableField(exist = false)
    private String payBank;
    public enum Type implements IEnum<Integer> {

        /**
         * 领用
         */
        collect(0,"领用"),
        /**
         * 修磨
         */
        repair(1,"修磨"),
        /**
         * 回收
         */
        recycle(2,"回收");

        private int code;
        private String desc;

        Type(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }
    /**
     * 账单类型
     */
    private Type type;

    /**
     * 账单类型描述
     */
    @TableField(exist = false)
    private String typeDesc;

    public String getTypeDesc() {
        return type == null ? null : type.getDesc();
    }
    /**
     * 付款账号
     */
    @TableField(exist = false)
    private String payNumber;
    @TableField(exist = false)
    private String startTime ;
    @TableField(exist = false)
    private String endTime ;
    @TableField(exist = false)
    private String billTotalMoney ;
    @TableField(exist = false)
    private String confirTime ; //确认时间
    @TableField(exist = false)
    private String confirmName ;
    @TableField(exist = false)
    private String pendingMoney ;
    @TableField(exist = false)
    private String num ;
    @TableField(exist = false)
    /**
     * 账单状态
     */
    private String billStatus;
}
